<!DOCTYPE>
<html>
<head>
	<include file="Public/head" />
	<link rel="stylesheet" href="__PUBLIC__/Manage/css/table.css">
	<script type="text/javascript" src="__PUBLIC__/Manage/js/wangEditor/wangEditor.min.js"></script>
	<title>基本设置</title>
	<style type="text/css">
		.layer-anim{
			top:180px !important;
		}
	</style>
</head>

<body>
<div class="nestable">
	<div class="console-title console-title-border drds-detail-title clearfix">
		<h5>基本设置</h5>
	</div>
	<div class="public-selectArea public-selectArea1 margin_10">
		<form action="{:U('Setting/index')}" method="post">
			<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>网站名称：</dt>
						<dd>
							<input type="text" name="siteName" value="{$Think.config.siteName|default=''}" />
						</dd>
						<em class="tishi">网站名称如   “**贷”  、 “**金融” </em>
					</dl>
				</div>
			</div>

			<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>网站标题：</dt>
						<dd>
							<input type="text" name="siteTitle" value="{$Think.config.siteTitle|default=''}" />
						</dd>
					</dl>
				</div>
			</div>
			
			<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>站点关键字：</dt>
						<dd>
							<input type="text" name="siteKeywords" value="{$Think.config.siteKeywords|default=''}" />
						</dd>
					</dl>
				</div>
			</div>

			<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>站点描述：</dt>
						<dd>
							<textarea rows="3" style="height: 100px;" name="siteDescription">{$Think.config.siteDescription|default=''}</textarea>
						</dd>
					</dl>
				</div>
			</div>
			<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>首页跑马灯：</dt>
						<dd>
							<input type="text" name="indexMarquee" value="{$Think.config.indexMarquee|default=''}" />
						</dd>
						<em class="tishi">首页跑马灯，为空不显示 </em>
					</dl>
				</div>
			</div>
			<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>合同名称：</dt>
						<dd>
							<input type="text" name="siteCorporate" value="{$Think.config.siteCorporate|default=''}" />
						</dd>
					</dl>
				</div>
			</div>

			<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>开启网站访问：</dt>
						<dd>
							<label><input type="radio" name="siteClose" value="0" <?php if(C("siteClose")== 0): ?>checked<?php endif; ?> >是</label>
							<label><input type="radio" name="siteClose" value="1" <?php if(C("siteClose")== 1): ?>checked<?php endif; ?> >否</label>
						</dd>
					</dl>
				</div>
			</div>

			<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>客服电话：</dt>
						<dd>
							<input type="text" name="siteServicenum" value="{$Think.config.siteServicenum|default=''}" />
						</dd>
					</dl>
				</div>
			</div>
		<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>在线客服：</dt>
						<dd>
								<php>$services_user= empty(C('services_user'))?'':htmlspecialchars_decode(htmlspecialchars_decode(C('services_user')));</php>
							<input type="text" name="services_user" value="{$services_user|default=''}" />
						</dd>
					</dl>
				</div>
				<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>客服代码：</dt>
						<dd>
								<php>$servicesCode= empty(C('servicesCode'))?'':htmlspecialchars_decode(htmlspecialchars_decode(C('servicesCode')));</php>
							<textarea rows="3" style="height: 100px;" name="servicesCode">{$servicesCode|default=''}</textarea>
						</dd>
					</dl>
				</div>
			</div>
			<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>App下载地址：</dt>
						<dd>
							<input type="text" name="public_url" value="{$Think.config.public_url|default=''}" />
						</dd>
					</dl>
				</div>
			</div>

			<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>允许上传文件类型：</dt>
						<dd>
							<php>$arr = C('fileSuffix');if($arr) $str = implode(',',$arr);</php>
							<input type="text" name="fileSuffix" value="{$str|default=''}" />
						</dd>
						<em class="tishi">多种文件类型以逗号隔开 如 （jpg,png,gif,jpeg,zip,doc）</em>
					</dl>
				</div>
			</div>

			<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>允许上传文件大小：</dt>
						<dd>
							<input type="text" name="fileSize" value="{$Think.config.fileSize|default=''}" />
						</dd>
						<em class="tishi">单位 （MB）</em>
					</dl>
				</div>
			</div>

			<div class="clearfix clearfix1">
				<div class="wp_box  col-xs-8">
					<dl>
						<dt>关于我们：</dt>
						<php>$siteAbout = empty(C('siteAbout'))?'':htmlspecialchars_decode(htmlspecialchars_decode(C('siteAbout')));</php>
						<dd>
							<input type="hidden" name="siteAbout" value="{$siteAbout|default=''}" />
							<div class="editor" id="editor">{$siteAbout|default=''}</div>
						</dd>
					</dl>
				</div>
			</div>
			<input type="hidden"  id="siteLogo" name="siteLogo" value="{$Think.config.siteLogo|default=''}" />
			<input type="hidden" id="bj1" name="bj1" value="{$Think.config.bj1|default=''}" />
			<input type="hidden" id="bj2" name="bj2" value="{$Think.config.bj2|default=''}" />
			<input type="hidden" id="bj3" name="bj3" value="{$Think.config.bj3|default=''}" />
		</form>
		<div class="clearfix clearfix1">
			<div class="wp_box  col-xs-8">
				<dl>
					<dt>网站轮播1：</dt>
					<dd>
						<div class="upimg bj1">
							<form action="{:U('Setting/uploadImg')}" method="post" enctype="multipart/form-data">
								<input type="file" name="bj1"/>
								<input type="hidden" name="fileName" value="bj1" />
							</form>
						</div>
					</dd>
					<em class="tishi"></em>
				</dl>
			</div>
		</div>
		<!--<div class="clearfix clearfix1">
			<div class="wp_box  col-xs-8">
				<dl>
					<dt>网站轮播2：</dt>
					<dd>
						<div class="upimg bj2">
							<form action="{:U('Setting/uploadImg')}" method="post" enctype="multipart/form-data">
								<input type="file" name="bj2" />
								<input type="hidden" name="fileName" value="bj2" />
							</form>
						</div>
					</dd>
					<em class="tishi"></em>
				</dl>
			</div>
		</div>
		<div class="clearfix clearfix1">
			<div class="wp_box  col-xs-8">
				<dl>
					<dt>网站轮播3：</dt>
					<dd>
						<div class="upimg bj3">
							<form action="{:U('Setting/uploadImg')}" method="post" enctype="multipart/form-data">
								<input type="file" name="bj3" />
								<input type="hidden" name="fileName" value="bj3" />
							</form>
						</div>
					</dd>
					<em class="tishi"></em>
				</dl>
			</div>
		</div>-->
		<div class="clearfix clearfix1">
			<div class="wp_box  col-xs-8">
				<dl>
					<dt>网站LOGO：</dt>
					<dd>
						<div class="upimg siteLogo">
							<form action="{:U('Setting/uploadImg')}" method="post" enctype="multipart/form-data">
								<input type="file" name="siteLogo" />
								<input type="hidden" name="fileName" value="siteLogo" />
							</form>
						</div>
					</dd>
					<em class="tishi">建议上传PNG背景透明图片</em>
				</dl>
			</div>
		</div>
		



		<div class="btnArea margin_20">
			<a href="javascript:;" class="btn btn-grayBg">
				<span class="public-label">提交</span>
			</a>
		</div>
	</div>
</div>
</body>
<script type="text/javascript">
    $(function(){
        var E = window.wangEditor;
        var editor = new E('#editor');
        editor.create();
        $(".img-view").remove();
        var logoImg = $("input[name='siteLogo']").val();
        if(logoImg.length > 0){
            $(".siteLogo").after("<div class='upimg img-view'><img src='" + logoImg + "' /></div>");
        }
		var bj1 = $("input[name='bj1']").val();
        if(bj1.length > 0){
            $(".bj1").after("<div class='upimg img-view'><img src='" + bj1 + "' /></div>");
        }
		 var bj2 = $("input[name='bj2']").val();
        if(bj2.length > 0){
            $(".bj2").after("<div class='upimg img-view'><img src='" + bj2 + "' /></div>");
        }
		 var bj3 = $("input[name='bj3']").val();
        if(bj3.length > 0){
            $(".bj3").after("<div class='upimg img-view'><img src='" + bj3 + "' /></div>");
        }

        $(".btnArea a").on('click',function(){
            $("input[name='siteAbout']").val(editor.txt.html());
            cvphp.submit($("form"),function(data){
                if(data.status!=1){
                    layer.msg(data.info);
                }else{
                    layer.alert('保存成功');
                }
            });
        });

        $("input[type='file']").on('change',function(){
            var value = $(this).val();
            if(value.length == 0){
                layer.msg("请选择上传文件");
                return false;
            }
            //上传图片
            var obj = $(this).parent();
            var fileinputObj = this;
			var name=$(this).attr("name");
            cvphp.submit($(obj),function(data){
                if(data.status != 1){
                    layer.msg(data.info);
                    return false;
                }else{
                    var imgUrl = "__PUBLIC__/Upload/" + data.info;
                    $("#"+name).val(imgUrl);
                    $("."+name).after("<div class='upimg img-view'><img src='" + imgUrl + "' /></div>");
                }
            });
        });
    });
</script>
</html>